package com.ysd.lis.controller.sys;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.SysBasDictTable;
import com.ysd.lis.entity.SysBasDictTableField;
import com.ysd.lis.request.CommonPageDto;
import com.ysd.lis.service.SysBasDictTableFieldService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 员工表
 * 前端控制器
 * </p>
 *
 * @author LiuQi
 * @since 2023-10-19
 */
@Api(tags = "基础字典分类")
@RestController
@RequestMapping("/api/sys/basDictTableField")
public class SysBasDictTableFieldController extends BaseController {
    @Autowired
    SysBasDictTableFieldService sysBasDictTableFieldService;

    @ApiOperation("查询")
    @GetMapping("/getDictTableFieldAndTableDataList")
    public Result getDictTableFieldAndTableDataList(CommonPageDto pageParam){
        return sysBasDictTableFieldService.getDictTableFieldAndTableDataList(pageParam);
    }

    @ApiOperation("批量新增")
    @PostMapping("/saveBatchTableField")
    public Result saveBatchTableField(@RequestBody SysBasDictTable table){
        return  sysBasDictTableFieldService.saveBatchTableField(table);
    }

    @ApiOperation("根据详情id删除详情数据")
    @PostMapping("/deleteDictTableField")
    public Result deleteDictTableField(@RequestBody SysBasDictTableField field) {
        return sysBasDictTableFieldService.deleteDictTableField(field);
    }

    @ApiOperation("修改")
    @PostMapping("/editDictTableField")
    public Result editDictTableField(@RequestBody SysBasDictTableField field){
        return  sysBasDictTableFieldService.editDictTableField(field);
    }

    @ApiOperation("查询")
    @GetMapping("/getTableFieldAndDataList")
    public Result getTableFieldAndDataList(CommonPageDto pageParam){
        return sysBasDictTableFieldService.getTableFieldAndDataList(pageParam);
    }

}
